﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Navigation;
using Toon.Dialogs;
using System.Windows.Browser;

namespace Toon.Views
{
	public partial class NewCharacter : Page
	{
		public NewCharacter()
		{
			InitializeComponent();
		}
		protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
		{
			if (CharacterSheet.HasOpenDialogs)
			{
				e.Cancel = true;
				Dispatcher.BeginInvoke(new Action(() =>{
					HtmlPage.Window.CurrentBookmark = NavigationService.CurrentSource.ToString().Replace(@"\", @"/");
					CharacterSheet.CloseDialogs();
				}));
			}
			base.OnNavigatingFrom(e);
		}
	}
}
